import requests
import yaml


def load_yaml(yaml_file):
    with open(yaml_file, 'r', encoding='utf-8') as f:
        data = yaml.load(f, Loader=yaml.FullLoader)

    return data


def request_json(url, payload=None):
    if payload is None:
        payload = {}

    headers = {
        "Content-Type": "application/json"
    }

    response = requests.post(
        url=url,
        headers=headers,
        json=payload
    )

    return response.json()


